package standino.velocity.db.db2.template;

import java.io.InputStream;

import org.apache.velocity.exception.ResourceNotFoundException;


public class ClasspathResourceLoader
    extends org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
{
    public synchronized InputStream getResourceStream(String name)
        throws ResourceNotFoundException
    {
        InputStream result = super.getResourceStream(name);
        if (result == null)
        {
            final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
            if (classLoader != null)
            {
                result = classLoader.getResourceAsStream(name);
            }
        }
        return result;
    }
}